package com.ruoyi.web.controller.system;

import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.dto.SysHomeControllerDTO;
import com.ruoyi.system.domain.vo.HomeStatisticsVO;
import com.ruoyi.system.service.SysHomeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/system/home")
@Slf4j
public class SysHomeController {
    @Autowired
    private SysHomeService sysHomeService;
    @PostMapping("statistics")
    public AjaxResult statistics(@RequestBody SysHomeControllerDTO dto){
        log.info(JSON.toJSONString(dto));
        HomeStatisticsVO vo = sysHomeService.statistics(dto);
        return AjaxResult.success(vo);
    }
}
